package com.lwc.cfdns.pojo.bo.system;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.lwc.cfdns.pojo.bo.AbstractPageQuery;
import com.lwc.cfdns.pojo.entity.SystemStation;
import com.lwc.cfdns.utils.StringUtils;
import lombok.Data;

/**
 * 岗位查询
 *
 * @author luwc
 * @title StationBO
 * @description
 * @time 2023/5/26 16:30:10
 * @version: 1.0
 */
@Data
public class StationBO extends AbstractPageQuery {
    private String code;
    private String name;
    private String status;

    /**
     * 生成query conditions
     *
     * @return LambdaQueryWrapper<T>
     * @throws
     * @version 1.0.0
     * @author luwc
     * @time 2023/4/26 20:17:17
     */
    @Override
    public LambdaQueryWrapper<SystemStation> toQueryWrapper() {
        LambdaQueryWrapper<SystemStation> lambdaQueryWrapper = new LambdaQueryWrapper<>();
        if (StringUtils.isNotEmpty(this.code)) {
            lambdaQueryWrapper.like(SystemStation::getCode, this.code);
        }
        if (StringUtils.isNotEmpty(this.name)) {
            lambdaQueryWrapper.like(SystemStation::getName, this.name);
        }
        if (StringUtils.isNotEmpty(this.status)) {
            lambdaQueryWrapper.eq(SystemStation::getStatus, this.status);
        }
        return lambdaQueryWrapper;
    }
}
